{extend name="public/base" /} 
{block name="sidebar"}{/block} 

{block name="style"}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/static/fullcalendar/fullcalendar.min.css" media="all"> 
<style>
    body{padding: 0}
    #main{margin-top: 50px;}
</style>
{/block} 

{block name="body"}
<!-- 主体 -->
<div id="indexMain" class="index-main">
	<div id="calendar"></div>
</div>
{/block} 

{block name="script"}
<script src="__PUBLIC__/static/fullcalendar/moment.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/fullcalendar/fullcalendar.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/fullcalendar/locale-all.js"></script>

<script>
	jQuery(function($) {
		$('.sidebar').remove();
		/* initialize the calendar
	-----------------------------------------------------------------*/

		var date = new Date();
		var d = date.getDate();
		var m = date.getMonth();
		var y = date.getFullYear();

		var calendar = $('#calendar').fullCalendar({
			header: {
				left: '',
				center: 'title',
				right: ''
			},
			views: {
		        week: {
		            titleFormat: 'YYYY年M月DD日'
		        },
		    },
		    axisFormat:'H(:mm)a',
			defaultView:'basicWeek',
            monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份缩略命名（英语比较实用：全称January可设置缩略为Jan）  
            dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],  //同理monthNamesShort  
            
            weekNumberCalculation: 'ISO',
            locale: 'es',

            allDaySlot:false,
			editable: false,
			droppable: false, // this allows things to be dropped onto the calendar !!!
			selectable: true,
			selectHelper: false,
			minTime:'07:00:00',
			maxTime:'22:00:00',
			
			events: {$_lists},
			//新增班级
			selectable:false,
			//班级详情
			eventClick: function(calEvent, jsEvent, view) {
				layer.open({
				    type: 2,
				    title: '班级详情',
				    content: calEvent.url,
				    area: ['80%', '80%'],
				    shadeClose: true, //开启遮罩关闭
				    maxmin: true
				});
				if (calEvent.url) {
		            return false;
		        }
			}
		});
	})
</script>
{/block}